package com.sdhillon;

import com.sdhillon.gallery.GridThumbnailView;
import com.sdhillon.listitem.IconDetailListItemDemo;

import android.app.ListActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class DemoSelect extends ListActivity {
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		String[] demos = new String[] { "Icon Detail List Item",
				"Grid Image Thumbnails" };
		setListAdapter(new ArrayAdapter<String>(this,
				android.R.layout.simple_list_item_1, demos));
	}

	// send off to the right demo
	@Override
	protected void onListItemClick(ListView l, View v, int position, long id) {
		super.onListItemClick(l, v, position, id);
		switch (position) {
		case 0:
			IconDetailListItemDemo.showView(this);
			return;
		case 1:
			GridThumbnailView.showView(this);
			return;
		}
	}
}